home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1 / Nebula One.iso / Misc / msql-1.0.6 / src / common / portability.h < prev    next >
C/C++ Source or Header  |  1994-11-27  |  1KB  |  67 lines

  1. /*
  2. **    portability.h    - 
  3. **
  4. **
  5. ** Copyright (c) 1993  David J. Hughes
  6. **
  7. ** Permission to use, copy, and distribute for non-commercial purposes,
  8. ** is hereby granted without fee, providing that the above copyright
  9. ** notice appear in all copies and that both the copyright notice and this
  10. ** permission notice appear in supporting documentation.
  11. **
  12. ** This software is provided "as is" without any expressed or implied warranty.
  13. **
  14. */
  15.  
  16.  
  17. #ifndef PORTABILITY_H
  18. #define PORTABILITY_H 
  19.  
  20. #include <common/config.h>
  21.  
  22. #ifndef HAVE_BCOPY
  23. #  undef     bzero
  24. #  undef     bcopy
  25. #  undef     bcmp
  26. #  define    bzero(a,l)    memset((void *)a,0,(size_t)l)
  27. #  define    bcopy(s,d,l)    memcpy(d,s,(size_t)l)
  28. #  define    bcmp        memcmp
  29. #endif
  30.  
  31. #ifndef HAVE_RINDEX
  32. #  undef    index
  33. #  undef    rindex
  34. #  define    index        strchr
  35. #  define    rindex        strrchr
  36. #endif
  37.  
  38. #ifndef HAVE_RANDOM
  39. #  undef    random
  40. #  undef    srandom
  41. #  define    random        srand
  42. #  define    srandom        srand
  43. #endif
  44.  
  45. #ifdef HAVE_SELECT_H
  46.     /*
  47.     ** AIX has a struct fd_set and can be distinguished by
  48.     ** its needing <select.h>
  49.     */
  50.     typedef struct fd_set fd_set
  51. #endif
  52.  
  53. #ifndef HAVE_U_INT
  54.     typedef    unsigned int u_int;
  55. #endif
  56.  
  57. #ifndef HAVE_FTRUNCATE
  58.     /*
  59.     ** SCO ODT doesn't have ftruncate() !!! Have to use old Xenix stuff
  60.     */
  61. #       undef    ftruncate
  62. #      define     ftruncate    chsize
  63. #endif
  64.  
  65.  
  66. #endif /* PORTABILTIY_H */
  67.